import Q from 'q'
import axios from 'axios'
import envFuncs from '@/config/base'
let env = envFuncs.getParams()
import { S, U, getRequestId, mapField } from '../../lib/backend'

export default {
  setCustomProperty({rootState}, info) {
    let CRM_API_HOST = env.CRM_API_HOST
    let url = CRM_API_HOST + '/sites/' + rootState.app.site_id + '/users/' + rootState.app.token + '/set_custom_property' + '?' + U(info || {}, false)
    return axios.post(url)
  },
  setDaLing({rootState}, info) {
    let CRM_API_HOST = env.CRM_API_HOST
    let url = CRM_API_HOST + '/sites/' + rootState.app.site_id + '/users/' + rootState.app.token + '/set_da_ling' + '?' + U(info || {}, false)
    return axios.get(url)
  }

}
